{% extends "admin/base.html" %}
{% load i18n %}
{% block content %}
<script type="text/javascript" src="/senbzblog/static/js/jquery.form.utf8.js"></script>
<script type="text/javascript" src="/senbzblog/static/admin/reply.js"></script>
<script type="text/javascript">
$(document).ready(function() { 
    $('#quick_post').ajaxForm({
    	resetForm: true,
    	clearForm: true,
        success:function(responseText,statusText, xhr,form){
			$('.message').empty().append(responseText)
        }
     }); 
}); 
</script>
<div>
 	<h2 class="title1">{% trans "Control Panel" %}</h2>
 	<div id="dashboard">
 		<div class="inner-sidebar">
 			<div id="dashboard-sidebar-content">
 				<div id="dashboard_quick_press" class="dashboard-window">
 					<h3><span>{% trans "Quick Post" %}</span></h3>
 					<div class="inside">
 					</div>
 				</div>
 			</div>
 		</div>
 		<div class="has-sidebar">
	 		<div id="dashboard-main-content">
				<div id="dashboard_right_now" class="dashboard-window">
					<h3><span>{% trans 'Current' %}</span></h3>
					<div class="inside">
						<p class="sub">{% trans 'Overview' %}</p>
						<div class="table">
							<table>
								<tr>
									<td class="num first"><a href="{{ blog.get_admin_show_articles_url }}">{{ artilce_count }}</a></td>
									<td class="first name">{% trans 'Articles' %}</td>
									<td class="num first"><a href="{{ blog.get_admin_comments_url }}">{{ comment_count }}</a></td>
									<td class="first name">{% trans 'Comment' %}</td>
								</tr>
								<tr>
									<td class="num"></td>
									<td class="name"></td>
									<td class="num"><a href="{{ blog.get_admin_comments_span_url }}">{{ spam_count }}</a></td>
									<td class="red name">{% trans 'Spam Comment' %}</td>
								</tr>
								<tr>
									<td class="num"><a href="{{ blog.get_admin_show_categories_url }}">{{ category_count }}</a></td>
									<td class="name">{% trans 'Categories' %}</td>
									<td class="num"><a href="#">{{ tag_count }}</a></td>
									<td class="name">{% trans 'Tags' %}</td>
								</tr>
							</table>
						</div>
						<div style="padding: 1px 10px 1px; margin:-12px;">
							<p><a href="{{ blog.get_admin_settings_url }}" class="button rbutton">{% trans 'Change Theme' %}</a>{% trans 'Theme' %}
							<span><a href="{{ blog.get_admin_settings_url }}">{{ blog.theme }}</a></span> 
							</p>
						</div>
					</div>
				</div>
				<div id="dashboard_recent_comments" class="dashboard-window">
					<h3><span>{% trans 'Recent Comments' %}</span></h3>
					<div class="inside">
						<div>
							{% for comment in comments %}
							<div class="list_item">
								<img width="50" height="50" style="float:left;"
									src="/site_media/{% if comment.user.get_profile.image_url %}{{ comment.user.get_profile.image_url }}{% else %}/static/images/default_user_picture.png{% endif %}"
									>
								<h4>
									<a class="name" href="{{ comment.content_object.get_absolute_url }}#comment-{{ comment.id }}" 
										target="_blank">{{ comment.content_object.title }}</a>
									{% trans 'From' %}&nbsp;
									<cite>
									 	{%if comment.user_url %}
									 	<a href="{{ comment.user_url }}" target="_blank">{{ comment.user_name }}</a>
									 	{%else%}
									 	{{ comment.user_name }}
									 	{%endif%}
									</cite> &nbsp;
									{% trans 'Comment' %} 
								</h4>
								<blockquote><p>{{ comment.comment|safe }} </p></blockquote>
								<p class="row-actions">
									{% if comment.is_public %}
					             	<span><a title="{% trans 'Spam Comment' %}" 
					             		href="{% url admin_comment_to_spam user.username,comment.id %}?approve=0">
					             			{% trans 'Spam Comment' %}</a></span>
					             	{%else%}
					             	<span><a title="{% trans 'Approve Spam comment' %}" 
					             		href="{% url admin_comment_to_spam user.username,comment.id %}?approve=1">
					             			{% trans 'Approve Comment' %}</a></span>
					             	{%endif%}
					             	<span>| 
					             		<a class="delete" href="javascript:senbz.delete_confirm('{% url admin_delete_comment user.username, comment.id %}?next={{request.path}}')">
					             			{% trans 'Delete' %}</a></span>
					             	<span>|
					             		<a href="{% url admin_edit_comment user.username, comment.id %}"> 
					             			{% trans 'Edit Comment' %}</a></span>
								</p>
							</div>
							{%endfor%}
						</div>
						<p><a class="button rbutton" href="{{ blog.get_admin_comments_url }}">
							{% trans 'See All' %}</a></p>
					</div>
					<div class="clear"></div>
				</div>
			</div>
 		</div>
 	</div>
 	<div class="clear"></div>
</div>
{%endblock%}